<template>
	<div class="login-container flex">
		<div class="login-box">
			<div class="login-right-warp-main-title">欢迎登录</div>
			<div class="login-right-warp-main-desc">欢迎来到机房安全监测系统</div>
			<div class="login-right-warp-main-form">
				<Account v-if="!isOpenVerificationCode" />
				<!-- 短信验证 -->
				<passwordVerification v-else ref="passwordVerificationRef"> </passwordVerification>
			</div>
		</div>
	</div>
</template>

<script setup lang="ts" name="loginIndex">
import { defineAsyncComponent, onMounted, ref } from 'vue';
// import { storeToRefs } from 'pinia';
import { NextLoading } from '/@/utils/loading';
import { storeToRefs } from 'pinia';
import { useUserInfo } from '/@/stores/userInfo';
// import logoMini from '/@/assets/images/hksj-logo-transparent.png';
// import loginMain from '/@/assets/login-main.svg';
// import loginBg from '/@/assets/login-bg.svg';
const storesUserInfo = useUserInfo();
const { isOpenVerificationCode } = storeToRefs(storesUserInfo);
// 引入组件
const Account = defineAsyncComponent(() => import('/@/views/login/component/account.vue'));
const passwordVerification = defineAsyncComponent(() => import('/@/views/login/component/passwordVerification.vue'));
// const Mobile = defineAsyncComponent(() => import('/@/views/login/component/mobile.vue'));
// const Scan = defineAsyncComponent(() => import('/@/views/login/component/scan.vue'));

// 定义变量内容

// const { themeConfig } = storeToRefs(storesThemeConfig);
const passwordVerificationRef = ref();

// // 获取布局配置信息
// const getThemeConfig = computed(() => {
//   return themeConfig.value;
// });

// 页面加载时
onMounted(() => {
	NextLoading.done();
});
</script>

<style scoped lang="scss">
/* 在线链接服务仅供平台体验和调试使用，平台不承诺服务的稳定性，企业客户需下载字体包自行发布使用并做好备份。 */
@font-face {
	font-family: 'ShuHeiTi';
	font-weight: 700;
	src: url('//at.alicdn.com/wf/webfont/1DiX2AIUCRpo/LVB8ypvGRau7.woff2') format('woff2'),
		url('//at.alicdn.com/wf/webfont/1DiX2AIUCRpo/tJY03Sy8BSAi.woff') format('woff');
	font-display: swap;
}

.login-container {
	position: relative;
	width: 100%;
	height: 100%;
	background-image: url('../../assets/images/login/login.svg');
	background-size: 100% 100%;
	background-color: #001f5f;
	.login-box {
		position: absolute;
		display: flex;
		flex-direction: column;
		right: 10%;
		top: 50%;
		transform: translateY(-50%);
		padding: 65px 55px;
		border-radius: 8px;
		width: 520px;
		height: 570px;
		overflow: hidden;
		background: linear-gradient(154deg, rgba(40, 87, 178, 0.7) 0%, rgba(31, 71, 154, 0.6) 100%);
		box-shadow: 0px 0px 44px 0px rgba(0, 42, 134, 0.8);

		.login-right-warp-main-title {
			font-size: 27px;
			animation: logoAnimation 0.3s ease;
			animation-delay: 0.3s;
			color: #ffffff;
		}

		.login-right-warp-main-desc {
			margin-top: 10px;
			margin-bottom: 30px;
			font-weight: 400;
			font-size: 18px;
			animation: logoAnimation 0.3s ease;
			animation-delay: 0.3s;
			color: #ffffff;
		}

		.login-right-warp-main-form {
			flex: 1;

			.login-content-main-sacn {
				position: absolute;
				top: 0;
				right: 0;
				width: 50px;
				height: 50px;
				overflow: hidden;
				cursor: pointer;
				transition: all ease 0.3s;
				color: var(--el-color-primary);

				&-delta {
					position: absolute;
					width: 35px;
					height: 70px;
					z-index: 2;
					top: 2px;
					right: 21px;
					background: var(--el-color-white);
					transform: rotate(-45deg);
				}

				&:hover {
					opacity: 1;
					transition: all ease 0.3s;
					color: var(--el-color-primary) !important;
				}

				i {
					width: 47px;
					height: 50px;
					display: inline-block;
					font-size: 48px;
					position: absolute;
					right: 1px;
					top: 0px;
				}
			}
		}
	}

	@media screen and (max-width: 768px) {
		.login-box {
			position: absolute;
			right: auto;
			top: 50%;
			transform: translateY(-50%);
			padding: 10px;
		}
	}
}
</style>
